package com.ruoyi.project.im.service.impl;

import com.ruoyi.project.im.domain.ImTemporaryMessage;
import com.ruoyi.project.im.mapper.ImTemporaryMessageMapper;
import com.ruoyi.project.im.service.IImTemporaryMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 临时消息Service业务层处理
 *
 * @author hongwj
 * @date 2024-04-16
 */
@Service
public class ImTemporaryMessageServiceImpl implements IImTemporaryMessageService {
    @Autowired
    private ImTemporaryMessageMapper imTemporaryMessageMapper;

    /**
     * 查询临时消息
     *
     * @param id 临时消息主键
     * @return 临时消息
     */
    @Override
    public ImTemporaryMessage selectImTemporaryMessageById(Long id) {
        return imTemporaryMessageMapper.selectImTemporaryMessageById(id);
    }

    /**
     * 查询临时消息列表
     *
     * @param imTemporaryMessage 临时消息
     * @return 临时消息
     */
    @Override
    public List<ImTemporaryMessage> selectImTemporaryMessageList(ImTemporaryMessage imTemporaryMessage) {
        return imTemporaryMessageMapper.selectImTemporaryMessageList(imTemporaryMessage);
    }

    /**
     * 新增临时消息
     *
     * @param imTemporaryMessage 临时消息
     * @return 结果
     */
    @Override
    public int insertImTemporaryMessage(ImTemporaryMessage imTemporaryMessage) {
            return imTemporaryMessageMapper.insertImTemporaryMessage(imTemporaryMessage);
    }

    /**
     * 修改临时消息
     *
     * @param imTemporaryMessage 临时消息
     * @return 结果
     */
    @Override
    public int updateImTemporaryMessage(ImTemporaryMessage imTemporaryMessage) {
        return imTemporaryMessageMapper.updateImTemporaryMessage(imTemporaryMessage);
    }

    /**
     * 批量删除临时消息
     *
     * @param ids 需要删除的临时消息主键
     * @return 结果
     */
    @Override
    public int deleteImTemporaryMessageByIds(Long[] ids) {
        return imTemporaryMessageMapper.deleteImTemporaryMessageByIds(ids);
    }

    /**
     * 删除临时消息信息
     *
     * @param id 临时消息主键
     * @return 结果
     */
    @Override
    public int deleteImTemporaryMessageById(Long id) {
        return imTemporaryMessageMapper.deleteImTemporaryMessageById(id);
    }
}
